package com.example.controller;

import com.example.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/statistics")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;

    @GetMapping("/sales")
    public List<Map<String, Object>> getSalesData() {
        return statisticsService.getSalesData();
    }

    @GetMapping("/userGrowth")
    public List<Map<String, Object>> getUserGrowthData() {
        return statisticsService.getUserGrowthData();
    }

    @GetMapping("/goodsSales")
    public List<Map<String, Object>> getGoodsSalesData() {
        return statisticsService.getGoodsSalesData();
    }
}